import request from "./index";

// 获取简历列表
export function getResumeList(params) {
    return request({
        url: "/resume/list",
        method: "get",
        params,
    });
}

// 获取简历详情
export function getResumeDetail(id) {
    return request({
        url: `/resume/detail/${id}`,
        method: "get",
    });
}

// 创建简历
export function createResume(data) {
    return request({
        url: "/resume/create",
        method: "post",
        data,
    });
}

// 更新简历
export function updateResume(data) {
    return request({
        url: "/resume/update",
        method: "put",
        data,
    });
}

// 删除简历
export function deleteResume(id) {
    return request({
        url: `/resume/delete/${id}`,
        method: "delete",
    });
}

// 上传简历附件
export function uploadResumeAttachment(data) {
    return request({
        url: "/resume/upload",
        method: "post",
        headers: {
            "Content-Type": "multipart/form-data",
        },
        data,
    });
}

// 投递简历
export function submitResume(data) {
    return request({
        url: "/resume/submit",
        method: "post",
        data,
    });
}

// 获取我已投递的简历列表
export function getSubmittedResumes(params) {
    return request({
        url: "/resume/submitted",
        method: "get",
        params,
    });
}

// 获取简历投递状态
export function getResumeSubmitStatus(id) {
    return request({
        url: `/resume/status/${id}`,
        method: "get",
    });
}

// 取消简历投递
export function cancelResumeSubmit(id) {
    return request({
        url: `/resume/cancel/${id}`,
        method: "delete",
    });
}
